﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>后台管理平台</title>    
    <link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet"/>   
</head>
<body>
 
<div id="content">
    <object id="idc30" type="application/x-alpaca-cardreader" width=0 height=0></object>
    <object id="pid30" type="application/x-alpaca-cardreader" width=0 height=0></object>
    <object id="ptr30" type="application/x-alpaca-printer" width=0 height=0></object>
    <object id="updater" type="application/x-alpaca-updater" width=0 height=0></object>
    <object id="system" type="application/x-alpaca-system" width=0 height=0></object>
    <object id="ak30" type="application/x-alpaca-analogkey" width=0 height=0></object>
    <div class="container" id="home" style="margin-top: 100px;">
        <div class="container" id="home" style="margin-top: 100px;">
            <div class="col-lg-2">
                <button class="btn btn-lg btn-success" onclick="openLock()">打开柜门</button>
            </div>
            <div class="col-lg-2">
                <button class="btn btn-lg btn-success" onclick="openLight()">打开灯</button>
            </div>
            <div class="col-lg-2">
                <button class="btn btn-lg btn-success" onclick="checkArchives()">盘点</button>
            </div>
            <div class="col-lg-2">
                <button class="btn btn-lg btn-success" onclick="scanRfid()">扫描标签</button>
            </div>
        </div>
    </div>
    
</div>
<footer class="navbar-fixed-bottom">
    <div class="container-fluid">
        <div class="footer">
            <div class="pull-right"><a href="http://www.hjjs.com/" target="_blank">河北汇金机电股份有限公司</a></div>
        </div>
    </div>
</footer>
<!-- 全局js -->
<script src="./jquery/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
    <script src="./layerui/layer.js"></script>
<script type="text/javascript">
    $(function (data) {
        layer.msg("start");
        //打印机添加回调事件
      //  ptr30.addEventListener("StatusChange", StatusChange);
        //ptr30.addEventListener("OpenComplete", OpenComplete);
       
    });
    function openLock() {
        var message = {
            code: "LockOpen",
            option: [{ip: "172.16.201.9", lockNum: "2", lightNum: "12"}],
            callBack: "test02"
        };
        Warehouse.Command(JSON.stringify(message));
    }

    function openLight() {
        //{"code": "SetLightState","option":[{ "ip": "172.16.201.9", "lightNum": "27", "state": "0"}]}
        var message = {
            code: "LockOpen",
            option: [{ip: "172.16.201.9", lightNum: "12", state: "0"}],
            callBack: "test02"
        };
        Warehouse.Command(JSON.stringify(message));
    }

    function alarmLight() {
//{"Code":"InventoryReal","option":[{"ip":"172.16.201.211","time":"27"}]}
        var message = {
            code: "AlarmLight",
            option: [{ip: "172.16.201.9", time: "60"}],
            callBack: "test02"
        };
        Warehouse.Command(JSON.stringify(message));
    }

    function test02(data) {
        console.log(data)
    }
    function checkArchives() {
        var message = {
            code: "InventoryReal",
            option: [{ ip: "172.16.201.50", antennas: "0,1,2" }],
            callBack: "test02"
        };
        Warehouse.Command(JSON.stringify(message));
    }
    function scanRfid() {
        var message = {code:"ReadEpc"};
        Filing.Command(JSON.stringify(message), function (data) {
            console.log(data);
            //layer.msg(data.msg);
        });
    }
</script>
</body>
</html>
